# include <stdio.h>
# include <string.h>
# include "Header.h"
# include "DirectoryOps.h"

int removeFile(char *filePath, struct VFS *header) {
	int i, j, l;
	for(i = 0; i < MAX_FD_SIZE; i++) {
		if(!strcmp(filePath, header -> fd[i].filePath)) {
			j = stringLength(filePath);
			while( *(filePath + j - 1) != '/' ) {	
				*(filePath + i - 1) = '\0';
				j--;
			}
			copyString(header->fd[i].filePath, filePath);

			for (l = 0; l < 50; l++) {
				header -> fd[i].fileName[l] = '\0';
			}
			for (l = 0; l < 5; l++) {
				header -> fd[i].fileType[l] = '\0';
			}
			for (l = 0; l < 1024; l++) {
				header->bl[i].data[l] = '\0';
			}
			return 1;
			
		}
	}
	return 0;
}
	
	
